#pragma once

#include "IDisposable.h"
#include "List Base.h"

using namespace System::Runtime::InteropServices;

namespace StillDesign
{
	namespace NvApi
	{
		generic<class T>
			where T : ref class, StillDesign::NvApi::IDisposable
		public ref class ElementCollection : ListBase<T>
		{
			public:
				ElementCollection();
				
			internal:
				void DisposeOfAll();
				
			private:
				void ElementCollection_OnAdd( System::Object^ sender, T item );
				void ElementCollection_OnRemove( System::Object^ sender, T item );
				
				void Element_OnDisposing( System::Object^ sender, EventArgs^ e );
		};
	};
};